1. Field of the Invention
The present invention relates to techniques for converting structured documents.
2. Description of the Related Art
XML (Extensible Markup Language) has been formulated by W3C (World Wide Web Consortium), a standards organization, as a language for describing documents. XML permits description of documents structured by components (nodes) such as elements and attributes.
A document described in XML is in a text format. However, there are techniques for expressing the same document in a binary format. Fast Infoset standardized by ITU-T (International Telecommunication Union-Telecommunication Standardization Sector) (ITU-T X.891) is a representative example of such techniques. Fast Infoset allows a document described in XML to be expressed with a decreased data size, using information on data type of nodes.
On the other hand, there are techniques, such as XSLT (Extensible Stylesheet Language Transformations) 1.0 formulated by W3C and VTL (Velocity Template Language) developed by The Apache Software Foundation, for converting a document into a structured document in another format using a template describing a conversion scheme.
To convert a structured document into another format, a user creates a template with XSLT 1.0 and specifies the template and the structured document to be converted in a program called a template engine that performs conversion processing.
In addition, Japanese Patent Laid-Open No. 2004-258773 discloses a technique for compressing an XML document using a template.
In general, it is possible to convert a structured document described in XML or the like into a structured document in another format described in XML, XHTML, or the like, using a template described in a template description language such as XSLT 1.0.
However, when a structured document is to be converted into a document in a binary XML format such as Fast Infoset that allows data representation other than character strings (e.g., floating point representation of IEEE754), it conventionally has not been possible to convert the document using a template.
In such a case, it is necessary to convert the document into a text XML document, which allows conversion using a template, and then convert the document into a binary XML document using an encoder for binary XML. Thus, conversion processes, such as analysis and output of the structured document, have to be performed multiple times. In addition, sufficient conversion speed may not be realized when a device with a low processing speed is used.